"use strict";
const common_vendor = require("../../../common/vendor.js");
const common_assets = require("../../../common/assets.js");
const utils_tools = require("../../../utils/tools.js");
const api_user = require("../../../api/user.js");
const stores_userInfo = require("../../../stores/userInfo.js");
if (!Array) {
  const _easycom_up_avatar2 = common_vendor.resolveComponent("up-avatar");
  const _easycom_personalModule2 = common_vendor.resolveComponent("personalModule");
  const _easycom_up_button2 = common_vendor.resolveComponent("up-button");
  const _easycom_up_modal2 = common_vendor.resolveComponent("up-modal");
  const _easycom_up_toast2 = common_vendor.resolveComponent("up-toast");
  (_easycom_up_avatar2 + _easycom_personalModule2 + _easycom_up_button2 + _easycom_up_modal2 + _easycom_up_toast2)();
}
const _easycom_up_avatar = () => "../../../node-modules/uview-plus/components/u-avatar/u-avatar.js";
const _easycom_personalModule = () => "../../../components/personalModule/personalModule.js";
const _easycom_up_button = () => "../../../node-modules/uview-plus/components/u-button/u-button.js";
const _easycom_up_modal = () => "../../../node-modules/uview-plus/components/u-modal/u-modal.js";
const _easycom_up_toast = () => "../../../node-modules/uview-plus/components/u-toast/u-toast.js";
if (!Math) {
  (_easycom_up_avatar + _easycom_personalModule + moduleOuterBox + _easycom_up_button + _easycom_up_modal + _easycom_up_toast)();
}
const moduleOuterBox = () => "../../../components/moduleOuterBox/moduleOuterBox.js";
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
  __name: "index",
  setup(__props) {
    const userInfoStore = stores_userInfo.useUserInfoStore();
    const uToastRef = common_vendor.ref(null);
    const info = common_vendor.ref(null);
    const showModal = common_vendor.ref(false);
    const businessMenu = common_vendor.ref([
      {
        id: 1,
        icon: common_assets.bszxIcon,
        title: "办事咨询",
        bgOffset0: "#fef9ec",
        bgOffset1: "#fffcf7",
        pageUrl: "/subPages/crowd/serviceConsultation/hisConsultation"
      },
      {
        id: 2,
        icon: common_assets.fwpjIcon,
        title: "服务评价",
        bgOffset0: "#F6FFFD",
        bgOffset1: "#F3FFFB",
        pageUrl: "/subPages/crowd/serviceEvaluation/allEvaluation"
      },
      {
        id: 3,
        icon: common_assets.jbtsIcon,
        title: "举报投诉",
        bgOffset0: "#ECF5FC",
        bgOffset1: "#F4F8FB",
        pageUrl: "/subPages/crowd/reportComplaint/hisComplaint"
      }
    ]);
    const getCrowdUserInfo = () => {
      api_user.crowdUserInfo({ crowdUserId: userInfoStore.userInfo.userId }).then((res) => {
        const { data } = res;
        info.value = data;
      }).catch((err) => {
        uToastRef.value.show({
          type: "error",
          message: err
        });
      });
    };
    common_vendor.onShow(() => {
      getCrowdUserInfo();
    });
    return (_ctx, _cache) => {
      return common_vendor.e({
        a: common_vendor.unref(info)
      }, common_vendor.unref(info) ? {
        b: common_vendor.p({
          src: common_vendor.unref(common_assets.norAvatar),
          shape: "circle",
          size: "125rpx",
          mode: "scaleToFit"
        }),
        c: common_vendor.t(common_vendor.unref(info).userName),
        d: common_vendor.t(common_vendor.unref(info).phonenumber),
        e: common_vendor.t(common_vendor.unref(info).communityName + (common_vendor.unref(info).alleyName ? common_vendor.unref(info).alleyName : "") + (common_vendor.unref(info).subdistrict ? common_vendor.unref(info).subdistrict : "") + (common_vendor.unref(info).building ? common_vendor.unref(info).building : "") + (common_vendor.unref(info).house ? common_vendor.unref(info).house : "")),
        f: common_vendor.o(($event) => common_vendor.unref(utils_tools.onPageJump)("/subPages/crowd/mine/editPersonalInfo")),
        g: common_vendor.p({
          height: 208,
          leftWidth: 165,
          showStatus: true,
          statusName: common_vendor.unref(info).residenceStatus === 0 ? "常住" : common_vendor.unref(info).residenceStatus === 1 ? "暂住" : "",
          statusBgColor: common_vendor.unref(info).residenceStatus === 0 ? "#33A954" : "#BBBBBB"
        })
      } : {}, {
        h: common_vendor.f(common_vendor.unref(businessMenu), (item, index, i0) => {
          return {
            a: item.icon,
            b: common_vendor.t(item.title),
            c: index,
            d: common_vendor.s(`background: linear-gradient(180deg, ${item.bgOffset0} 0%, ${item.bgOffset1} 100%);`),
            e: common_vendor.o(($event) => common_vendor.unref(utils_tools.onPageJump)(item.pageUrl), index)
          };
        }),
        i: common_vendor.p({
          moduleTitle: "我的事项",
          moduleIcon: common_vendor.unref(common_assets.wdsxIcon)
        }),
        j: common_vendor.o(($event) => showModal.value = true),
        k: common_vendor.o(($event) => showModal.value = false),
        l: common_vendor.p({
          type: "info",
          hairline: true,
          text: "取消"
        }),
        m: common_vendor.o(common_vendor.unref(userInfoStore).logout),
        n: common_vendor.p({
          type: "primary",
          hairline: true,
          text: "确定退出"
        }),
        o: common_vendor.p({
          show: common_vendor.unref(showModal),
          title: "确定退出登录？",
          content: "退出后部分功能将无法正常使用",
          contentTextAlign: "center"
        }),
        p: common_vendor.sr(uToastRef, "cf3c0ae6-6", {
          "k": "uToastRef"
        })
      });
    };
  }
});
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-cf3c0ae6"]]);
wx.createPage(MiniProgramPage);
